package com.ttn.entities;

import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.Min;

import org.hibernate.validator.constraints.NotEmpty;


@Entity
@Table(name="car_hire")
public class CarHire implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -7029752663067882286L;

	@Id
	@Column(name="id")
	@GeneratedValue(strategy=IDENTITY)
	private long id;
	
	@Column(name="price")
	private Double price = new Double(0);
	
	@ManyToOne
	@JoinColumn(name="user_id")
	private User user;
	
	@Column(name="car")
	@NotEmpty
	private String car;
	
	@Column(name="driver_included")
	private boolean driverIncluded;
	
	@Column(name="number_of_days")
	@Min(value=1)
	private int numberOfDays;
	
	@Column(name="city")
	@NotEmpty
	private String city;
	
	
	@Column(name="comment")	
	private String comment;
	
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public String getCar() {
		return car;
	}
	public void setCar(String car) {
		this.car = car;
	}
	public boolean isDriverIncluded() {
		return driverIncluded;
	}
	public void setDriverIncluded(boolean driverIncluded) {
		this.driverIncluded = driverIncluded;
	}
	public int getNumberOfDays() {
		return numberOfDays;
	}
	public void setNumberOfDays(int numberOfDays) {
		this.numberOfDays = numberOfDays;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public String getComment() {
		return comment;
	}
	public void setComment(String comment) {
		this.comment = comment;
	}
	public Double getPrice() {
		return price;
	}
	public void setPrice(Double price) {
		this.price = price;
	}
	
	

}
